import request from '@/utils/request'

  export function report(params) {
	return request({
	  url: 'api/loanManage/checkReport/checkReportHtml',
	  method: 'get',
	  params
	})
  }
  
  export function addReport(data) {
	return request({
	  url: 'api/loanManage/checkReport/checkReportHtml',
	  method: 'post',
	  data
	})
  }
  
  export function loanList(params) {
	return request({
	  url: 'api/loanManage/creditAccounts',
	  method: 'get',
	  params
	})
  }

  export function contractDetails(id) {
	return request({
	  url: 'api/loanManage/creditAccount/contract/' + id,
	  method: 'get'
	})
  }

  export function check(params) {
	return request({
	  url: 'api/loanManage/loanBackCheck/tasks',
	  method: 'get',
	  params
	})
  }

  export function task(params) {
	return request({
	  url: 'api/loanManage/loanBackCheck/tasks/contracts',
	  method: 'get',
	  params
	})
  }


  export function selectTask(data) {
	return request({
	  url: 'api/loanManage/loanBackCheck/task',
	  method: 'post',
	  data
	})
  }

  export function editRule(data) {
	return request({
	  url: 'api/loanManage/taskRule',
	  method: 'put',
	  data
	})
  }
  export function addRule(data) {
	return request({
	  url: 'api/loanManage/taskRule',
	  method: 'post',
	  data
	})
  }
  export function delRule(id) {
	return request({
	  url: 'api/loanManage/taskRule/' + id,
	  method: 'delete'
	})
  }


  export function integratedList(params) {
	return request({
	  url: 'api/loanManage/loanBackComplexManage',
	  method: 'get',
	  params
	})
  }

  export function configList(params) {
	return request({
	  url: 'api/loanManage/template',
	  method: 'get',
	  params
	})
  }

  export function publish(data) {
	return request({
	  url: 'api/loanManage/template/publish',
	  method: 'put',
	  data
	})
  }

  export function delConfig(id) {
	return request({
	  url: 'api/loanManage/template?ids=' + id,
	  method: 'delete'
	})
  }


  export function templaList(params) {
	return request({
	  url: 'api/loanManage/templateBusiRelation',
	  method: 'get',
	  params
	})
  }


  export function kickIn(data) {
	return request({
	  url: 'api/loanManage/templateBusiRelation/valid',
	  method: 'put',
	  data
	})
  }

  export function inkickIn(data) {
	return request({
	  url: 'api/loanManage/templateBusiRelation/invalid',
	  method: 'put',
	  data
	})
  }

  
  export function addTemplate(data) {
	return request({
	  url: 'api/loanManage/templateBusiRelation',
	  method: 'post',
	  data
	})
  }





  export function assure(params) {
	return request({
	  url: 'api/loanManage/creditAccount/guaranteeContracts',
	  method: 'get',
	  params
	})
  }



  export function assureDetails(id) {
	return request({
	  url: 'api/loanManage/creditAccount/guaranteeContract/' + id,
	  method: 'get'
	})
  }




  export function collateral(params) {
	return request({
	  url: 'api/loanManage/creditAccount/collaterals',
	  method: 'get',
	  params
	})
  }

  export function collateralDetails(id) {
	return request({
	  url: 'api/loanManage/creditAccount/collateral/' + id,
	  method: 'get'
	})
  }



  export function processTree() {
	return request({
	  url: 'task/workflow-task/query/candidateGroup/firstTask?processDefinitionId=report_check_process:2:06677af6-17d1-11ea-8c68-c0a5dda0ba60',
	  method: 'get'
	})
}

export function processSecondTree(id) {
	return request({
	  url: 'task/workflow-task/query/candidateGroup/firstTask?taskId='+id,
	  method: 'get'
	})
}


// export function processNextTree(id) {
// 	return request({
// 	  url: 'task/workflow-task/query/candidateGroup?taskId='+id,
// 	  method: 'get'
// 	})
// }
export function processNextTree(id,data) {
	console.log(data)
	return request({
	  url: 'task/workflow-task/query/candidateGroup?taskId='+id,
	  method: 'post',
	//  params:data
	  data
	})
}




//   export function subProcessId(id) {
// 	return request({
// 	  url: 'task/workflow-processForm/rest/process-instances?claimUserId='+id,
// 	  method: 'post',
// 	  id
// 	})
//    }

  export function subProcessId(data) {
	return request({
	  url: 'task/workflow-processForm/rest/process-instances',
	  method: 'post',
	  data
	})
   }

   export function busiProcess(data) {
	return request({
	  url: 'api/busiProcess',
	  method: 'post',
	  data
	})
   }
 export function getProcessDefinitionId(id) {
	return request({
	  url: 'api/processBusiConfig/processInfo?busiFlag=' + id ,
	  method: 'get'
	})
}


export function processTreeLoanList(id) { 
    return request({
		url: 'task/workflow-task/query/candidateGroup?processDefinitionId=' + id,
		method: 'post',
	})
}	

//    export function processTreeLoanList() {  
// 	return request({
// 	 url: 'task/workflow-task/query/candidateGroup?processDefinitionId=test_loan_after_process:1:5c69e2ec-2788-11ea-b64b-c0a5dda0ba60',
// 	  method: 'post',
// 	})
// }